<?
// Error.php
// written by: David Fudge [ rkstar@mac.com ]
// created on: November 1, 2008
// last modified: November 1, 2008
//
// description:
// this file contains functions that will allow us to store
// error messages and review them at any time.

// load dependencies here
ed::load("Core.Core");
ed::load("Core.Utils");

class Error extends Core
{
	public $error;			// an array of errors
	public $message;		// an array of messages that are not errors

	public function __construct()
	{
		$this->error   = array();
		$this->message = array();
	}
	
	public function add( $text, $isError=true )
	{
		if( strlen($text) < 1 ) { return; }
		// push the array
		$array = ($isError) ? $this->error : $this->message;
		array_push($array,$text);
	}
	
	public function clearErrors() { $this->error = array(); }
	public function clearMessages() { $this->message = array(); }
	
	public function getErrors() { return $this->error; }
	public function getMessages() { return $this->message; }
}
?>